How to enable EditMenu in a listBox?? 
Author Message
 How to enable EditMenu in a listBox??

I can't seem to enable the Edit menu when I click inside my listbox.  My
books say that editfields and listboxes both should have a MenuEnable
event and I should be able to enable the Edit menu but I can't.  How would
I go about enabling the edit menu when I click in the listBox?

Thanks,

Sam



Sun, 01 Feb 2004 01:23:40 GMT  
 How to enable EditMenu in a listBox??

Quote:

> I can't seem to enable the Edit menu when I click inside my listbox.  My
> books say that editfields and listboxes both should have a MenuEnable
> event and I should be able to enable the Edit menu but I can't.  How would
> I go about enabling the edit menu when I click in the listBox?

Your listbox must be a listbox subclass; otherwise you don't get an event.
That is explained in chapter 6 of my book, and see p. 483 of for an
example (shows how to implement copy and paste for a listbox, using the
Edit menu). You can download the example from my web site if you want (ch.
23). m.

--

*** REALbasic, The Definitive Guide! ***
http://www.oreilly.com/catalog/realbasic/



Sun, 01 Feb 2004 05:46:59 GMT  
 How to enable EditMenu in a listBox??
In article

Quote:



> > I can't seem to enable the Edit menu when I click inside my listbox.  My
> > books say that editfields and listboxes both should have a MenuEnable
> > event and I should be able to enable the Edit menu but I can't.  How would
> > I go about enabling the edit menu when I click in the listBox?

> Your listbox must be a listbox subclass; otherwise you don't get an event.
> That is explained in chapter 6 of my book, and see p. 483 of for an
> example (shows how to implement copy and paste for a listbox, using the
> Edit menu). You can download the example from my web site if you want (ch.
> 23). m.

Hi Matt!  Love the book, its what got me hooked in RB.  My list box is a
'listbox' subclass, if I click on it in the window editor, the Propterties
window, under ID, says 'super: listbox'.  If I go into the code editor
though, and expand my 'listbox' under 'Controls' there is no
'EnableMenuItems' event like your book says...  Am I looking in the wrong
place?


Sun, 01 Feb 2004 06:18:05 GMT  
 How to enable EditMenu in a listBox??

Quote:

> In article




> > > I can't seem to enable the Edit menu when I click inside my listbox.  My
> > > books say that editfields and listboxes both should have a MenuEnable
> > > event and I should be able to enable the Edit menu but I can't.  How would
> > > I go about enabling the edit menu when I click in the listBox?

> > Your listbox must be a listbox subclass; otherwise you don't get an event.
> > That is explained in chapter 6 of my book, and see p. 483 of for an
> > example (shows how to implement copy and paste for a listbox, using the
> > Edit menu). You can download the example from my web site if you want (ch.
> > 23). m.

> Hi Matt!  Love the book, its what got me hooked in RB.  My list box is a
> 'listbox' subclass, if I click on it in the window editor, the Propterties
> window, under ID, says 'super: listbox'.  If I go into the code editor
> though, and expand my 'listbox' under 'Controls' there is no
> 'EnableMenuItems' event like your book says...  Am I looking in the wrong
> place?

So it is NOT a listbox subclass. It is a listbox. That won't do. That's
exactly what I'm trying to tell you. I know it's weird, but that's the way
it works.

A listbox subclass would be a subclass that you have made, subclassing
listbox. The properties window when you click on your listbox would not
say super: listbox. It would have the name of some other class, the one
you made, which appears in the project window. You would edit the code in
the subclass code editor - not in the controls part of the window code
editor.

Again: read p. 483 carefully, download the example.

I may be leaping to conclusions here (it's hard teaching at this distance,
so don't be insulted if I'm misinterpreting the signals), but it may be
that you are not grasping what I mean when I say "subclass". Nothing wrong
with that, but you might want to review chapter 4, which explains what a
subclass is and how to make one. m.

--

*** REALbasic, The Definitive Guide! ***
http://www.oreilly.com/catalog/realbasic/



Sun, 01 Feb 2004 07:14:29 GMT  
 How to enable EditMenu in a listBox??

Quote:



> > In article




> > > > I can't seem to enable the Edit menu when I click inside my listbox.  My
> > > > books say that editfields and listboxes both should have a MenuEnable
> > > > event and I should be able to enable the Edit menu but I can't.
How would
> > > > I go about enabling the edit menu when I click in the listBox?

> > > Your listbox must be a listbox subclass; otherwise you don't get an event.
> > > That is explained in chapter 6 of my book, and see p. 483 of for an
> > > example (shows how to implement copy and paste for a listbox, using the
> > > Edit menu). You can download the example from my web site if you want (ch.
> > > 23). m.

> > Hi Matt!  Love the book, its what got me hooked in RB.  My list box is a
> > 'listbox' subclass, if I click on it in the window editor, the Propterties
> > window, under ID, says 'super: listbox'.  If I go into the code editor
> > though, and expand my 'listbox' under 'Controls' there is no
> > 'EnableMenuItems' event like your book says...  Am I looking in the wrong
> > place?

> So it is NOT a listbox subclass. It is a listbox. That won't do. That's
> exactly what I'm trying to tell you. I know it's weird, but that's the way
> it works.

> A listbox subclass would be a subclass that you have made, subclassing
> listbox. The properties window when you click on your listbox would not
> say super: listbox. It would have the name of some other class, the one
> you made, which appears in the project window. You would edit the code in
> the subclass code editor - not in the controls part of the window code
> editor.

> Again: read p. 483 carefully, download the example.

> I may be leaping to conclusions here (it's hard teaching at this distance,
> so don't be insulted if I'm misinterpreting the signals), but it may be
> that you are not grasping what I mean when I say "subclass". Nothing wrong
> with that, but you might want to review chapter 4, which explains what a
> subclass is and how to make one. m.

Ah hah, looking at chapter 4 clears things up.  RB is still new to me,
give me Java or PERL or whathave you and I'll subclass, this whole GUI
programming thing has me off balance.  Its clear now, thanks!

Sam



Sun, 01 Feb 2004 07:37:14 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How dis/enable a button depending on a listbox

2. Listbox background paint and *my* listbox bug

3. Tk Listbox bindings (was: Tk Listbox Question)

4. listbox-rtb (listbox recolor) for TK4.0

5. Making Tk listboxes behave like MS-Windows listboxes

6. Enable/Disable pushbuttons

7. enabling, disabling, checking popup menus

8. Bug in menu enables

9. Toolbar button enabling

10. Language Environment Enabled Assembler Programs

11. Break points active and enabled but not working

12. Web enabled smalltak

 

 
Powered by phpBB® Forum Software